home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 351-375 / disk_356 / algorhythms / algorhythms.doc < prev    next >
Text File  |  1992-05-06  |  33KB  |  932 lines

  1.  
  2. AlgoRhythms User Manual
  3.  
  4. AlgoRhythms 1.0
  5.  
  6. Algorithmic Composition Software by Thomas E. Janzen
  7.  
  8. AlgoRhythms 1.0 software Copyright (c) 1990 Thomas E. Janzen
  9.  
  10. Thomas E. Janzen makes no warranties, either expressed or
  11. implied, with respect to the software program recorded on the
  12. diskette or the instructions, their quality, performance,
  13. merchantability or fitness for any particular purpose. The
  14. program and instructions are distributed free "as is". The entire
  15. risk as to their quality and performance is with the user. In no
  16. event will Thomas E. Janzen be liable for direct, indirect,
  17. incidental or consequential damages resulting from any defect
  18. in the program or instructions, even if Thomas E. Janzen has
  19. been advised of the possibility of such damages.
  20.  
  21. This software may be redistributed only intact with no change and
  22. only at no charge.
  23.  
  24. Your comments about AlgoRhythms are very welcome as soon as you
  25. have tried the program.  Your comments and questions about
  26. AlgoRhythms may be directed to:
  27.  
  28. Thomas E. Janzen
  29. 35 Briarwood Lane #4
  30. Marlborough, MA  01752
  31. 1 (508) 485-1657
  32.  
  33. Commodore (TM), Amiga (TM) are trademarks of Commodore Business
  34. Machines, Inc.  Lattice is a trademark of Lattice, Inc.  MIDI is
  35. specified by the International MIDI Association (IMA).
  36.  
  37. No part of this software may be used in whole or in part in
  38. another public domain or commercial software.  No music produced
  39. by this program may be used for commercial purposes.
  40.  
  41. INTRODUCTION
  42.  
  43. Algorithmic composition software makes a computer into a
  44. composer.  Algorithmic composition is at least 35 years old,
  45. first heard from LeJaren Hiller's Illiac Suite.  Hiller's
  46. computer program wrote music in batch mode and printed it out as
  47. alpha-numeric characters, from which it was transcribed by hand
  48. onto music paper for performance by a human string quartet. In
  49. the 1960's, Greek composer Iannis Xenakis made many good modern
  50. pieces in a very formal way, and a few times used a computer to
  51. calculate the form of the piece, in a way closely related to the
  52. way that AlgoRhythms does.  An alphnumeric print-out was
  53. transcribed for human players, as before.  Many commercial
  54. programs for algorithmic composition have appeared recently, and
  55. usually develop melodic fragments to aid improvisation in pop
  56. music.  Some can play MIDI instruments directly, and in real
  57. time.  AlgoRhythms was written to avoid melodies and to avoid a
  58. regular beat.  The concept of sinusoidally-varying formal
  59. parameters used by AlgoRhythms was developed in 1976 and used in
  60. two of my manually written piano pieces: "Animations" (1977) and
  61. "Lucy's Dance" (1982).  Form files roughly reproducing these
  62. works are available with other examples  of forms in the forms
  63. subdirectory .  Although the Amiga Intuition interface makes
  64. AlgoRhythms easy to use, the one disadvantage is that the user
  65. needs to perform mental trigonometry.
  66.  
  67. In AlgoRhythms, the computer chooses the pitches, durations, and
  68. dynamics (loudnesses) played to one MIDI channel so that a MIDI
  69. instrument can play the music that the Amiga "improvises."
  70. The user of the software chooses a shape for the piece.  The
  71. shape of the piece is determined by how the pitches, durations,
  72. and dynamics slowly change with time while the music plays.
  73. AlgoRhythms plays music in real time while it makes choices of
  74. pitches, durations, and dynamics, and can run virtually
  75. indefinitely.
  76.  
  77. This software does not read or save MIDI file-specification
  78. files or any other score file.  The files saved by this software
  79. are merely the parameters of the overall form of the piece, which
  80. are selected by the user.  This program does not display the
  81. music in musical notation, but in a graphical notation instead.
  82. This program does not use the internal Amiga voices.  It plays on
  83. up to 16 MIDI channels at a given time.  This program does not
  84. receive MIDI data.  It may be that incoming data would make it
  85. crash.  It is best not to have any incoming MIDI data.  When the
  86. music starts, a MIDI Start command is sent.  When the music is
  87. stopped by the Stop Command, a MIDI Stop command is sent.  MIDI
  88. clock commands are sent about 25 times a second regardless of
  89. tempo, except when Pulse is set to zero (0), when no MIDI clocks
  90. are sent.
  91.  
  92. AlgoRhythms was compiled with Lattice (TM) C 5.05.
  93.  
  94. HARDWARE REQUIREMENTS
  95.  
  96. AlgoRhythms probably would run on an Amiga with 512K bytes of
  97. memory.  It was developed on a two mega-byte Amiga 500 with an
  98. ECE (TM) MIDI adaptor.  The serial port is used to send MIDI
  99. data.  Therefore a MIDI interface is required on the serial port. 
  100. A MIDI synthesizer must be connected to the MIDI interface. 
  101. AlgoRhythms does not use internal Amiga voices.
  102.  
  103. RUNNING ALGORHYTHMS
  104.  
  105. To run AlgoRhythms, click the right mouse button twice on the
  106. AlgoRhythms drawer, then click twice on the AlgoRhythms project
  107. icon.  AlgoRhythms will create a window with a four-menu-strip
  108. menu, and draw a randomized starting form for the music.  The
  109. beginning duration of the piece is ten minutes.  The form that
  110. AlgoRhythms begins with is randomized, that is, pseudo-random
  111. numbers were used to select the periods and phases of the
  112. parameters, of which more later.  The shape of the randomized
  113. form is drawn after AlgoRhythms is started.  If you wish, you may
  114. play this randomized piece by selecting the Play menu item.
  115.  
  116. USING ALGORHYTHMS
  117.  
  118. The AlgoRhythms window is a Workbench window that can be re-
  119. sized.  When the window is re-sized using the sizing gadget with
  120. the mouse, the graphical form curves are refreshed in the new
  121. proportions.  If the close gadget is used, all playing activity
  122. is stopped and the program terminates.  The front-to-back gadget
  123. works normally.  The drag gadget is useful for moving the window
  124. if it is small enough to move inside the screen.
  125.  
  126. THE ALGORHYTHMS MENU
  127.  
  128. There are three menu strips in the AlgoRhythms menu.  All of the
  129. menu selections are available whether or not music is playing. 
  130. If they were all visible at once, they would look a little like
  131. this:
  132.  
  133. Projects    Form            Scales        Voices
  134. Play    A-P    Max Voices A-V        Chromatic        Voice 0
  135. Stop A-S    ReDraw    A-R        Short Pentatonic    Voice 1
  136. Continue A-C    Pulse    A-N        hira joshi        Voice 2
  137. Load A-L    Duration A-D        kumoi joshi        Voice 3
  138. Save A-F    Pitch            kokin joshi        Voice 4
  139. About A-A    Rhythm            Whole Tone        Voice 5
  140. Quit    A-Q     Dynamics        Diatonic        Voice 6
  141.         Texture            Harmonic Minor        Voice 7
  142.         Note Length        Hungarian Minor        Voice 8
  143.                     Diminished        Voice 9
  144.                     Long Pentatonic        Voice 10
  145.                     Transposition    A-T    Voice 11
  146.                                 Voice 12
  147.                                 Voice 13
  148.                                 Voice 14
  149.                                 Voice 15
  150.  
  151. In addition, some Form menu strip items have sub menus.  Pitch,
  152. Rhythm, and Dynamics have the following sub-menu:
  153.  
  154. Mean Period
  155. Mean Phase
  156. Spread Period
  157. Spread Phase
  158. Randomize
  159.  
  160. Texture has the sub-menu:
  161.  
  162. Spread Period
  163. Spread Phase
  164. Randomize
  165.  
  166. The Note Length item has the sub-menu:
  167.  
  168. Minimum
  169. Maximum
  170.  
  171. The Projects Menu
  172.  
  173. Play A-P
  174.  
  175. If you select the Play function with the mouse or by hitting the
  176. Right Amiga key and the "P" key, the music will start playing via
  177. the serial port.  In addition, a line will be drawn along the
  178. Pitch curve to show time passing as the piece progresses.
  179. Before starting to play, AlgoRhythms sends a MIDI Start command.
  180. This is useful for recording AlgoRhythms with a MIDI sequencer. 
  181. Notes are played with the MIDI Note On command.  Before a new
  182. note is sent out to an AlgoRhythms voice, a Note Off command is
  183. sent to stop the previous note.  MIDI clock commands are sent
  184. about 25 times a second regardless of the setting of Pulse.
  185.  
  186. Stop A-S
  187.  
  188. If you select the Stop function with the mouse or by hitting the
  189. Right Amiga key and the "S" key, the music will stop playing if
  190. it had been playing.  MIDI Note Off commands are sent to notes
  191. that were on when you activated the Stop function.  After all
  192. notes are stopped, a MIDI Stop command is sent.
  193.  
  194. Continue A-C
  195.  
  196. If you select the Continue function with the mouse or by hitting
  197. the Right Amiga key and the "C" key, the music will continue in
  198. the graph where it left off when you hit "Stop."  A MIDI Continue
  199. command will be sent.
  200.  
  201. Load A-L
  202.  
  203. If you select the Load function with the mouse or by hitting the
  204. Right Amiga key and the "L" key, a requester will appear with a
  205. string gadget for you to enter the name of a form file to load. 
  206. AlgoRhythms does not read or write SMUS files, MIDI files, or any
  207. other score file.  AlgoRhythms files are summaries of the form or
  208. shape of the piece selected in the Form and Scales menu strips. 
  209. Because form files are text files, you can edit them in a text
  210. editor and load them, but they must be in the exact form below.
  211.  
  212. Form files may not have comments.  The comments below are
  213. tutorial.
  214.  
  215. 600.00    -- duration of the piece, in seconds
  216. 0.0        -- minimum duration for any note
  217. 2.0       -- maximum duration for any note
  218. 13        -- number of notes in the scale
  219. 48        -- the MIDI note numbers of the scale pitches
  220. 50
  221. 53
  222. 55
  223. 58
  224. 60
  225. 62
  226. 65
  227. 67
  228. 70
  229. 72
  230. 74
  231. 77
  232. 16        -- maximum number of voices playing at once
  233. 10        -- pulses per second
  234. 200.00    Pitch form -- Mean period in seconds
  235. -1.57        -- starting phase of mean in radians
  236. 200.00        -- Spread period in seconds
  237. -1.57        -- Spread starting phase in radians
  238. 200.00    Rhythm form -- Mean period in seconds
  239. 1.57            -- starting phase of mean in radians
  240. 200.00        -- Spread period in seconds
  241. -1.57        -- spread starting phase in radians
  242. 200.00    Dynamics form -- Mean period in seconds
  243. -1.57        -- starting phase of mean in radian
  244. 200.00        -- Spread period in seconds
  245. -1.57        -- spread starting phase in radians
  246. 200.00    Texture form -- Spread period in seconds
  247. -1.57        -- starting phase of spread in radians
  248. 24  96  0  1 Low Pitch, High Pitch, MIDI Channel, Walking
  249. 24  96  0  1
  250. 24  96  0  1
  251. 24  96  0  1
  252. 24  96  0  1
  253. 24  96  0  1
  254. 24  96  0  1
  255. 24  96  0  1
  256. 24  96  0  1
  257. 24  96  0  1
  258. 24  96  0  1
  259. 24  96  0  1
  260. 24  96  0  1
  261. 24  96  0  1
  262. 24  96  0  1
  263. 24  96  0  1
  264.  
  265. The last sixteen lines give the lowest pitch, highest pitch, MIDI
  266. channel (of 0 to 15) and walking (walking=1; not walking=0) for
  267. each of the 16 AlgoRhythms voices.  These can be changed while
  268. the program is running.  The lowest pitch is the lowest pitch
  269. allowed in the voice.  This helps you avoid having AlgoRhythms
  270. play pitches that do not sound good for a particular sample, for
  271. example.  If the voice is walking up and down the scale, it will
  272. turn around at the lowest pitch and highest pitch and head back
  273. towards the middle of the range of the instrument.  If the voice
  274. is playing random notes, It will simply not play notes that are
  275. out of range, defined by the lowest note and highest note.
  276.  
  277. Loading edited files affords the opportunity of loading scales
  278. other than the scales in the scales menu.  Transposition works on
  279. imported scales.
  280.  
  281. If you select the Load function and the file does not exist, the
  282. screen will flash and a tone will beep.  The form will not
  283. change.
  284.  
  285. There are several example form files in the forms subdirectry.
  286.  
  287. AlgoRhythms/Forms/
  288.  
  289.   animations.form                  arctan.form
  290.   circle.form                      cosine.form
  291.   fastwalk.form                    loud.form
  292.   lucy.form                        mean.form
  293.   normdist.form                    range.form
  294.   sine.form                        stddev.form
  295.   tan.form                         tests.form
  296.   variance.form                Gamelan.form
  297.  
  298. The names of the form files have no special meaning, except that
  299. Animations.form and Lucy.form represent recreations of the
  300. original works to use the formal techniques used in AlgoRhythms.
  301.  
  302. Save A-F
  303.  
  304. If you select the Save function with the mouse or by hitting the
  305. Right Amiga key and the "F" key, a requester with a string gadget
  306. will appear into which you may type a file name for saving the
  307. form file, described above.  A name similar to "file.form" is
  308. recommended.
  309.  
  310. About A-A
  311.  
  312. If you select the About function with the mouse or by hitting the
  313. Right Amiga key and the "A" key, you will see a copyright notice
  314. for AlgoRhythms.
  315.  
  316. Quit A-Q 
  317.  
  318. If you select the Quit function with the mouse or by hitting the
  319. Right Amiga key and the "Q" key, or hit the window close gadget,
  320. the music will stop and AlgoRhythms will exit.
  321.  
  322. Form Menu
  323.  
  324. Max Voices A-V
  325.  
  326. If you select the Max Voices function with the mouse or by
  327. hitting the Right Amiga key and the "V" key, a requester with a
  328. string gadget will appear into which you can type a number from 1
  329. to 16 for the maximum number of voices to be playing, when the
  330. waveform for Texture is at its peak.  Voice 0 always plays.  The
  331. low-numbered AlgoRhythms voices have precedence.  If you specify
  332. three voices, voices 0, 1, and 2 play, for example.
  333.  
  334. ReDraw A-R
  335.  
  336. If you select the ReDraw function with the mouse or by hitting
  337. the Right Amiga key and the "R" key, the graphical representation
  338. of the form of the music will be refreshed in the AlgoRhythms
  339. window.  This is useful for showing the new form after Form
  340. parameters have been changed.
  341.  
  342. Pulse A-N
  343.  
  344. If you select the Pulse function with the mouse or by hitting the
  345. Right Amiga key and the "N" key, a requester with a string gadget
  346. will appear into which you can type the number of pulses per
  347. second that the music should have.  Values from 5 to 12 make a
  348. real difference.  Numbers over 20 have little effect.  Numbers
  349. over 25 would have no effect at all.  Entering a zero would
  350. eliminate quantization, and the rhythm would be very fluid.  The
  351. actual tempo lags behind the pulse setting somewhat, but this has
  352. not been characterized.  Casual measurements give 6 pulses per
  353. second when 8 is chosen, and higher values seem to lag to an even
  354. greater extent.  MIDI Timing Clocks are sent about 25 times a
  355. second regardless of tempo unless Pulse is set to zero, in which
  356. case no Timing Clocks are sent.
  357.  
  358. Duration A-D
  359.  
  360. If you select the Duration function with the mouse or by hitting
  361. the Right Amiga key and the "D" key, a requester with a string
  362. gadget will appear allowing you to enter a duration, in seconds,
  363. for the piece of music.  After the music plays for this duration,
  364. the music stops.  You may set any length from zero up.
  365.  
  366. Pitch
  367.  
  368. If you select the Pitch function with the mouse, you will
  369. activate the Pitch sub-menu.  This sub-menu is the heart of the
  370. form-controlling technique used by AlgoRhythms, and is used for
  371. Rhythm and Dynamics as well.  The menu items are:
  372.  
  373. Mean Period
  374. Mean Phase
  375. Spread Period
  376. Spread Phase
  377. Randomize
  378.  
  379. The "Periods" of the Mean and Spread are in seconds.  The phases
  380. are angles.
  381.  
  382. Mean Period
  383.     The Mean Period is the period of the sine-wave oscillation
  384. of the rough mean value.  For the Pitch menu-item, Mean Period is
  385. the length of the cycle through which the mean value for pitch
  386. moves.  A sine-wave moves up and down gradually with time:
  387.  
  388.     **           **
  389.   *    *       *    *
  390. *       *    *       *
  391.           **           **
  392.  
  393. The wave is shown with phase zero.  Here is a sine-wave with
  394. different phases, in radians:
  395.  
  396. 1 * pi radians:
  397.  
  398.          **
  399. *      *    *
  400.  *   *       *
  401.   **           **
  402.  
  403. .5 * pi radians:
  404.  
  405. *           **
  406.   *       *    *
  407.     *    *       *
  408.       **           **
  409.  
  410. -0.5 * pi radians:
  411.  
  412.       **
  413.     *    *
  414.   *       *
  415. *           **
  416.  
  417. There are 2 * pi (6.28...) radians in a circle.  1 * pi
  418. (3.14159...) radians is a semi-circle.  The proportional gadget
  419. for entering phase is a horizontal slider.  Zero phase is in the
  420. center.  Pi radians (half circle) is all the way to the right and
  421. minus Pi radians is all the way to the left.
  422.  
  423. If you enter a period of 180 seconds, it will take the mean pitch
  424. three minutes to move all the way up and down the range of the
  425. scale before returning to the beginning phase.  If you enter
  426. 10000 seconds for the period, the mean pitch will virtually not
  427. change at all.  Sometimes you will want a form parameter to
  428. remain at one value; this is the way to do it.
  429.  
  430. The equation for pitch without any spread is:
  431.  
  432. pitchpoint = sin( 2 * pi * time / period  + phase)
  433.  
  434. pitch_index= (pitchpoint + 1) * scale_range
  435.  
  436. pitch=scale(pitch_index)
  437.  
  438. Spread gives a range from which the pitch is chosen using random
  439. numbers.  Any pitch in the range set by the spread is allowed.
  440. Like mean values, spread has a period and starting phase.  When
  441. spread is high, any pitch within the scale could be used (if mean
  442. is in the middle of the scale).  When spread is low, you will
  443. hear a repeated pitch resulting from only the pitch mean and
  444. phase.
  445.  
  446. If you use the walking option, none of the Pitch form parameters
  447. affect the music at all.
  448.  
  449. Let's say that you set the periods of mean pitch and pitch spread
  450. to be the same, perhaps 120 seconds (two minutes), and you set
  451. the starting phase of the mean pitch to be zero, and the starting
  452. phase of the pitch spread to be zero, the separate waveforms
  453. could look like this:
  454.  
  455. Mean Pitch:
  456.              120"
  457.     **          
  458.   *    *       *
  459. *       *    *  
  460.           **    
  461.  
  462. Pitch Spread:
  463.     **          
  464.   *    *       *
  465. *       *    *  
  466.           **    
  467.  
  468. In the graphical representation on the AlgoRhythms window, the
  469. pitch form would be respresented like this:
  470.  
  471.     **         
  472.   *****       *
  473. *   **  *    **
  474.          **   
  475.  
  476. This form makes the piece begin with pitches in the middle of the
  477. scale, and gradually raise in average pitch, while at the same
  478. time using a wider and wider range of pitches, until 30 seconds
  479. into the piece when the whole top of the scale is being used. 
  480. Then the mean pitch falls until 1:30 into the piece when it plays
  481. only a few very low pitches.
  482.  
  483. If you use the Randomize sub-item, the parameter will be
  484. randomized.  Use ReDraw to see what values were chosen.  The two
  485. periods will be about a couple minutes long, and the two phases
  486. could be anything from -pi to +pi.
  487.  
  488. Rhythm
  489.  
  490. If you select the Rhythm function with the mouse, you will
  491. activate the Rhythm sub-menu.  The Rhythm sub-menu works exactly
  492. like the Pitch sub-menu.  Note that the unit is time.  The higher
  493. the Rhythm graph is, the longer the notes are, and the slower the
  494. music is.  The wider the Rhythm graph, the greater variety of
  495. durations.  If the Rhythm graph is narrow, the beat is more
  496. regular.
  497.  
  498. Dynamics
  499.  
  500. If you select the Dynamics function with the mouse, you will
  501. activate the Dynamics sub-menu.  Dynamics form works exactly like
  502. Pitch form and Rhythm form.  The higher the graph, the louder the
  503. music.  The wider the curve, the greater variety of loudnesses
  504. will be heard.  A variety of dynamics tends to sound more human
  505. and rhythmic, as opposed to a single loudness level, which sounds
  506. mechanical.
  507.  
  508. Texture
  509.  
  510. If you select the Texture function with the mouse, you will
  511. activate the Texture sub-menu.  Texture form does not have a
  512. mean, it has only spread period and spread phase.  As the spread
  513. of the texture graph is greater, more voices (up to Max Voices)
  514. play.  Voice priority is from voice zero up.  That is, voice 0
  515. always plays, so the MIDI channel assigned to voice 0 always
  516. plays.  Voice one is selected next, two after that, and so on.
  517.     
  518. Note Length
  519.  
  520. If you select the Note Length menu item with the mouse, you will
  521. activate the Note Length sub-menu.  Use the mouse to select the
  522. either "Minimum" or "Maximum" from the sub-menu.  Type a length
  523. of time in seconds into the string gadget in the requester to set
  524. the mininum length of time a note may last or the maximum length
  525. of time a note may last.  The random duration of a note is chosen
  526. in the range set by the minimum and maximum note length.  The
  527. purpose of this was to allow synthesizer voices with long attacks
  528. to speak fully before ending, even if the rhythm form specified
  529. short notes.  Setting the minimum note length to a few seconds
  530. and the maximum note length to something longer allows you to
  531. make slow music with long gentle attacks, decays, and releases.
  532.  
  533. Scales Menu
  534.  
  535. If you select a scale in the Scales menu, that scale immediately
  536. takes effect in the music.  The long scales range from MIDI pitch
  537. 24 to just below 108.  The short scales range about a fifth below
  538. middle C to about a twelfth above middle C.  If you need more
  539. detail about these scales, see the Scales.c source code in the
  540. AlgoRhythms/source/ subdirectory.  Note that you can create new
  541. scales by editing them (as MIDI note numbers) into a form file
  542. and loading the form file.  See the section above on form file
  543. format.
  544.  
  545. Chromatic
  546.     This long scale is a chromatic scale of over six octaves
  547. from MIDI 24 to 107.
  548.  
  549. Short Pentatonic
  550.     This short scale is a pentatonic scale from the C below
  551. middle-C to the F an eleventh above middle-C, including C, D, F,
  552. G, B-flat.
  553.  
  554. hira joshi
  555. kumoi joshi
  556. kokin joshi
  557.     These short scales are tunings of the classical Japanese
  558. instruments, the koto.
  559.  
  560. Whole Tone
  561.     This long scale is a long scale including only C, D, E, F#,
  562. G#, A#.
  563.  
  564. Diatonic
  565.     This long scale is the white keys of the piano, which
  566. corresponds to C-major.
  567.  
  568. Harmonic Minor
  569.     This long scale, in C, consists of C, D, E-flat, F, G, A-
  570. flat, B.
  571.  
  572. Hungarian Minor
  573.     This long scale, in C, consists of C, D, E-flat, F#, G, A-
  574. flat, B.
  575.  
  576. Diminished
  577.     This long scale consists of C, D, E-flat, F, F#, G#, A, B.
  578.  
  579. Long Pentatonic
  580.     This long scale consists of C, D, F, G, B-flat.
  581.  
  582. Transposition A-T
  583.  
  584.     If you select the Transposition item with the mouse or by
  585. hitting the Right-Amiga key and the "T" key, a requester with a
  586. string gadget will appear, permitting you to enter the number of
  587. half-steps to transpose the scale.  This takes effect
  588. immediately.  For example, if AlgoRhythms is playing in the
  589. diatonic scale, and you use Tranposition to tranpose the scale by
  590. +3 steps, the new scale will correspond to E-flat major instead
  591. of C-major.
  592.  
  593. Voices Menu
  594.  
  595.     When you select the Voices menu, you see 16 voices, 0
  596. through 15.  These are AlgoRhythms voices, not voices on your
  597. synthesizer. Selecting a channel number for each voice activates
  598. a requester that permits set-up for a voice:
  599.  
  600. High Note
  601. ____C7_______
  602. Low Note
  603. ____C1_______
  604. Channel
  605. ____0________
  606.  
  607.     Voice Parameters
  608.       
  609. Cancel  |  Walking  |  OK
  610.  
  611. "High Note" and "Low Note" define the range allowed in the voice. 
  612. As explained before, a voice will not play out-of-range notes in
  613. random mode, and turns back from range boundaries in walk mode.
  614. Note that, in random notes (non-walking) mode, if your current
  615. scale has a broader range than the AlgoRhythms voices (set with
  616. High Note and Low Note), AlgoRhythms may go silent because it is
  617. selecting notes that are out of range for the voices.  This is
  618. likely to happen when the pitch curve is very thin and very high. 
  619. In such an instance, wait a minute for the music to return. 
  620. Otherwise, stop and re-arrange parameters and ranges to avoid
  621. this situation.  Click the right mouse button over the String
  622. Gadget for High Note or Low Note, and type in the note and
  623. octave, for example:
  624.  
  625. C7, C#7, Db6, Ab5 are note names suitable for High Note.
  626. c0, C#1, eb2, G#3, Fb3 are suitable for Low Note.
  627.  
  628. Note that C4 is middle C (ca. 261 Hz) and that the flat sign is
  629. just a 'b' or 'B' (bravo), and the sharp sign is a pound sign.
  630.  
  631. In the integer gadget used for channel number, you may enter the
  632. MIDI channel you want that voice to play to.  This permits
  633. separate voices to play on separate synthesizer sounds.  Only the
  634. number of voices 0 to max_voices-1 (selected in the Forms menu)
  635. will play.   If you wish to hear all the voices when different
  636. channels are assigned, use "OMNI ON" on your synthesizer.  Any
  637. AlgoRhythms voice may be set to any MIDI channel.  Two different
  638. voices may be set to the same MIDI channel.  When AlgoRhythms
  639. starts, all voices are assigned to MIDI channel 0 (of 0 to 15, or
  640. channel 1 of 1 to 16).
  641.  
  642.     If you select the Walking item with the mouse, the voice
  643. will toggle back and forth between playing random notes in the
  644. scale, or playing notes adjacent to the last note played in each
  645. voice.  A mathematical random walk allows a drunk to take any
  646. sized step in any direction.  AlgoRhythms uses a walk that can do
  647. three things: it can go up a step, down a step, or not move.
  648. When the walk comes to a voice's Low Note or High Note, it turns
  649. back in the other direction.  A walking voice completely
  650. disregards the Pitch form curve.
  651.  
  652. Graphic output
  653.  
  654. AlgoRhythms draws a graphic representation of the shape or form
  655. of the piece to be played.  In the drawing there are four
  656. waveforms labeled "Pitch," "Rhythm," "Dynamics," and "Texture."
  657. As the music plays, you will see a time line move across the
  658. Pitch curve.  Note the following:
  659. The higher the pitch curve, the higher the pitch (unless
  660. walking).
  661. The thicker the pitch curve, the wider the range playing (within
  662. the voice's range).
  663. The higher the Rhythm curve, the slower the music plays.
  664. The thicker the Rhythm curve, the less regular the music is.
  665. The higher the Dynamic curve, the louder the music.
  666. The thicker the Dynamic curve, the more variety in dynamics,
  667. i.e., the more accented the music sounds.
  668. The thicker the Texture curve, the more voices play, to
  669. max_voice.
  670.  
  671. Getting Good Music from AlgoRhythms
  672.  
  673. It is possible for AlgoRhythms to produce music which is fairly
  674. pretty, and even somewhat human-like.  The music can sound as
  675. though someone is idly improvising with no pretense to melodic
  676. development.  The music can sound pretty due to the "windchime
  677. effect."  Windchimes with a pretty scale will produce euphony
  678. regardless of how the wind hits the chimes.  The prettiest scales
  679. in AlgoRhythms are the Pentatonic scales and the hira joshi
  680. scale.  In addition, by using the "walking" pitch selection, the
  681. pitches roam up and down the scale, sounding vaguely melodic.
  682. Using the Short_Pentatonic scale with walking pitch selection can
  683. produce surprisingly human results.  Wider spreads of dynamics
  684. also sound more accented and rhythmic.
  685.  
  686. The whole-tone scale is also fairly pretty regardless of what is
  687. played.  This scale was common in French Impressionism,
  688. especially in works of Debussy.
  689.  
  690. Because voice number zero has precedence, it amounts to the solo
  691. voice.  The other voices function usually as accompaniment, at
  692. times overtaking the solo.  Therefore, if you use multiple
  693. synthesizer voices, you may wish to assign voice zero to a
  694. soloist voice, such as a saxophone, trumpet, clarinet, or
  695. electric guitar.  The middle voices (remember that you a limited
  696. by how you set max_voice) could be accompaniment instruments such
  697. as guitar, piano, and even drums.  The last voices (close to
  698. max_voice) could be unusual voices that add surprising colors
  699. once in a while, because they only play when the texture curve is
  700. very thick.
  701.  
  702. The sinusoid form curves used by AlgoRhythms were developed for
  703. controlling musical form by the author in 1976.  The purpose was
  704. to answer the question: how can music be organized if there are
  705. no high-Q, narrow-bandwidth, musical pitches in the music?  The
  706. history of Western classical music has been the history of
  707. organizing sound by pitch.  Counterpoint, harmony and melodic
  708. studies were the center of musical developement for hundreds of
  709. years because the instruments used made clear pitches of narrow
  710. bandwidth.  What if we used instruments of low-Q, higher
  711. bandwidth sounds?  For example, filtered white noise, such as
  712. ocean surf sounds, wind sounds, drum sounds, and so on, can not
  713. be organized using either Bach's counterpoint, tonal harmony, or
  714. Schoenberg's serial technique.  (It took Boulez and Stockhausen
  715. to try to arrange percussion sounds in a serial fashion.) 
  716. Nevertheless, such sounds can be high or low, fast or slow, and
  717. loud or soft.  I came on the idea of slowly changing the
  718. character of the music by curves that created gradual changes
  719. that never stayed in one character of music for very long.  The
  720. mean and range of pitch, pace, and dynamic, were graphed on paper
  721. in 1976 almost exactly as AlgoRhythms graphs them.  My musical
  722. taste at the time called for fluid non-regular rhythm,
  723. non-motivic wanderings, and gradually changing character of
  724. music.  The purpose of AlgoRhythms is to implement this approach
  725. to organizing sound, even though, most of the time, it is used
  726. with high-Q musical sounds from MIDI instruments.
  727.  
  728. STRUCTURE OF ALGORHYTHMS
  729.  
  730. AlgoRhythms was my first large C program (about 2800 lines), and
  731. it suffers from that distinction.  Nevertheless, I will outline
  732. the structure for those who want to understand it.
  733.  
  734. There are several source files for the AlgoRhythms program.  
  735.  
  736. AlgoRhythms.c and AlgoRhythms.h
  737. Scales.c and Scales.h
  738. Window.c and Window.h
  739. Menus.c and Menus.h
  740. Gadgets.c and Gadgets.h
  741. DrawForm.c and DrawForm.h
  742. MIDIserial.c and MIDIserial.h
  743. MusicTimer.c and MusicTimer.h
  744.  
  745. AlgoRhythms.c contains the code with most of the meat in it.
  746. It manages the work performed by the other modules.  It contains
  747. the routine MakeEvent, which selects the exact pitch, duration,
  748. and dynamic to use when playing the next note event.  It contains
  749. the musical structures, Events (the list of notes currently
  750. playing), and the form structures, Pitch_Form, Duration_Form,
  751. Dynamics_Form, and Texture_Form.   The form structures contain
  752. the selections made on the menus or brought in from the form
  753. file.  They include the four parameters mean period, mean phase,
  754. spread period and spread phase described above.  Texture_Form has
  755. all four members, but only spread period and spread phase are
  756. used to determine how many voices should be playing.
  757.  
  758. Scales.c holds the available musical scales, and permits
  759. transposition of the current scale into any key.  Other scales
  760. can be used in the program by editing them into a form file and
  761. loading the file into the program. 
  762.  
  763. Window.c contains set-up and management code for the window.
  764.  
  765. Menus.c contains the menu structures and menu decoder, but does
  766. not take any action on menu events.  Action on menu events is all
  767. taken in AlgoRhythms.c.
  768.  
  769. Gadgets.c produces the requester and gadget for string input, a
  770. sliding gadget for phase input, and the Voice Parameter
  771. requester.
  772.  
  773. DrawForm.c draws or refreshes the graphical representation of the
  774. music to be played, and draws the time indicator.
  775.  
  776. MIDIserial.c opens the serial device at the MIDI baud rate,
  777. writes MIDI note-on and note-off commands to the serial device,
  778. and closes it at the end of the program.
  779.  
  780. MusicTimer.c opens the timer device and provides AlgoRhythms with
  781. the current time.  Time in AlgoRhythms is measured in a double
  782. (floating-point) number of seconds, with microseconds.  It was
  783. intended to avoid quantized musical time, in preference for fluid
  784. time without a beat.  Probably an integer representation would
  785. have served just as well.  In fact, musical time is quantized by
  786. the "pulse" selection anyway, in twenty-fifths of a second, but
  787. this can be over-ridden by selecting a zero value for "pulse."
  788.  
  789. BIBLIOGRAPHY
  790.  
  791. Bolognesi, T. 1983.  "Automatic Composition: Experiments with
  792. Self-Similar Music."  Computer Music Journal 7(1):25-36
  793.  
  794. Janzen, Thomas E.  "Categories of Aesthetic Appeal in Computer
  795. Music." M.I.T. Computer Music Journal 10(3), included in On the
  796. Wires of Our Nerves Heifetz, ed., Buchnell U. Press 1989
  797.  
  798. Myhill, John.  1979.  "Controlled Indeterminacy:  A First Step
  799. Toward a Semistochastic Music Language."  M.I.T. Computer Music
  800. Journal 3(3).  Included in Foundations of Computer Music, Roads
  801. and Strawn, ed. M.I.T. Press, Cambridge, 1985.
  802.  
  803. Xenakis, I. 1971.  Formalized Music.  Bloomington: Indiana
  804. University Press.
  805.  
  806. Thanks to Len Fehskens for performing initial test and offering
  807. practical suggetions, resulting in many improvements and
  808. features.
  809.  
  810. APPENDIX
  811.  
  812. Note Names and MIDI Numbers
  813.  
  814. MIDI    Pitch    Frequency
  815.  
  816.   12      C 0    16.35
  817.   13      C#0    17.32
  818.   14      D 0    18.35
  819.   15      D#0    19.45
  820.   16      E 0    20.60
  821.   17      F 0    21.83
  822.   18      F#0    23.12
  823.   19      G 0    24.50
  824.   20      G#0    25.96
  825.   21      A 0    27.50
  826.   22      A#0    29.14
  827.   23      B 0    30.87
  828.   24      C 1    32.70
  829.   25      C#1    34.65
  830.   26      D 1    36.71
  831.   27      D#1    38.89
  832.   28      E 1    41.20
  833.   29      F 1    43.65
  834.   30      F#1    46.25
  835.   31      G 1    49.00
  836.   32      G#1    51.91
  837.   33      A 1    55.00
  838.   34      A#1    58.27
  839.   35      B 1    61.74
  840.   36      C 2    65.41
  841.   37      C#2    69.30
  842.   38      D 2    73.42
  843.   39      D#2    77.78
  844.   40      E 2    82.41
  845.   41      F 2    87.31
  846.   42      F#2    92.50
  847.   43      G 2    98.00
  848.   44      G#2    103.83
  849.   45      A 2    110.00
  850.   46      A#2    116.54
  851.   47      B 2    123.47
  852.   48      C 3    130.81
  853.   49      C#3    138.59
  854.   50      D 3    146.83
  855.   51      D#3    155.56
  856.   52      E 3    164.81
  857.   53      F 3    174.61
  858.   54      F#3    185.00
  859.   55      G 3    196.00
  860.   56      G#3    207.65
  861.   57      A 3    220.00
  862.   58      A#3    233.08
  863.   59      B 3    246.94
  864.   60      C 4    261.63
  865.   61      C#4    277.18
  866.   62      D 4    293.66
  867.   63      D#4    311.13
  868.   64      E 4    329.63
  869.   65      F 4    349.23
  870.   66      F#4    369.99
  871.   67      G 4    392.00
  872.   68      G#4    415.30
  873.   69      A 4    440.00
  874.   70      A#4    466.16
  875.   71      B 4    493.88
  876.   72      C 5    523.25
  877.   73      C#5    554.37
  878.   74      D 5    587.33
  879.   75      D#5    622.25
  880.   76      E 5    659.26
  881.   77      F 5    698.46
  882.   78      F#5    739.99
  883.   79      G 5    783.99
  884.   80      G#5    830.61
  885.   81      A 5    880.00
  886.   82      A#5    932.33
  887.   83      B 5    987.77
  888.   84      C 6    1046.50
  889.   85      C#6    1108.73
  890.   86      D 6    1174.66
  891.   87      D#6    1244.51
  892.   88      E 6    1318.51
  893.   89      F 6    1396.91
  894.   90      F#6    1479.98
  895.   91      G 6    1567.98
  896.   92      G#6    1661.22
  897.   93      A 6    1760.00
  898.   94      A#6    1864.66
  899.   95      B 6    1975.53
  900.   96      C 7    2093.00
  901.   97      C#7    2217.46
  902.   98      D 7    2349.32
  903.   99      D#7    2489.02
  904.  100      E 7    2637.02
  905.  101      F 7    2793.83
  906.  102      F#7    2959.96
  907.  103      G 7    3135.96
  908.  104      G#7    3322.44
  909.  105      A 7    3520.00
  910.  106      A#7    3729.31
  911.  107      B 7    3951.07
  912.  108      C 8    4186.01
  913.  109      C#8    4434.92
  914.  110      D 8    4698.64
  915.  111      D#8    4978.03
  916.  112      E 8    5274.04
  917.  113      F 8    5587.65
  918.  114      F#8    5919.91
  919.  115      G 8    6271.93
  920.  116      G#8    6644.88
  921.  117      A 8    7040.00
  922.  118      A#8    7458.62
  923.  119      B 8    7902.13
  924.  120      C 9    8372.02
  925.  121      C#9    8869.85
  926.  122      D 9    9397.27
  927.  123      D#9    9956.06
  928.  124      E 9    10548.08
  929.  125      F 9    11175.30
  930.  126      F#9    11839.82
  931.  127      G 9    12543.86
  932.